// ml:run = $bin > input
#include <iostream>
#include <ctime>
#include <cstdlib>

int const maxn = 1000000;

int main()
{
    std::ios::sync_with_stdio(false);
	std::srand(std::time(0));
    int T = 10;
    std::cout << T << "\n";
    for (int ti = 1; ti <= T; ti++) {
        int n = maxn, m = rand() % maxn, p = rand() % n;

        std::cout << n << " " << m << " " << p << "\n";

        for (int i = 1; i <= n; i++) std::cout << rand() % maxn << " ";
        std::cout << "\n";
        for (int i = 1; i <= m; i++) std::cout << rand() % maxn << " ";
        std::cout << "\n";
    }
}

